package com.ucombuy.user.dao;

import com.ucombuy.user.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

@Component
public interface UserMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int checkUsername(String username);

    User selectLogin(@Param("username") String username, @Param("password") String password);

    int checkEmail(String email);

    String selectQuestionByUsername(String username);

    int checkAnswer(@Param ("username") String username,@Param ("question") String question,@Param ("answer") String answer);

    int updatePasswordByUsername(@Param ("username") String username,@Param ("passwordNew") String passwordNew);

    int checkPassword(@Param ("passwordOld") String passwordOld,@Param ("userId") Integer userId);

    int checkEmailByUserId(@Param(value = "email")String email,@Param(value = "userId")Integer userId);
}